package com.xbao.dao;

import com.xbao.model.StuClsRel;
import com.xbao.model.StuClsRelExample;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

@Mapper
public interface StuClsRelMapper {
    @SelectProvider(type=StuClsRelSqlProvider.class, method="countByExample")
    int countByExample(StuClsRelExample example);

    @DeleteProvider(type=StuClsRelSqlProvider.class, method="deleteByExample")
    int deleteByExample(StuClsRelExample example);

    @Delete({
        "delete from stu_cls_rel",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into stu_cls_rel (id, sid, cid, ",
        "createtime)",
        "values (#{id,jdbcType=BIGINT}, #{sid,jdbcType=BIGINT}, #{cid,jdbcType=BIGINT}, ",
        "#{createtime,jdbcType=BIGINT})"
    })
    int insert(StuClsRel record);

    @InsertProvider(type=StuClsRelSqlProvider.class, method="insertSelective")
    int insertSelective(StuClsRel record);

    @SelectProvider(type=StuClsRelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT)
    })
    List<StuClsRel> selectByExample(StuClsRelExample example);

    @Select({
        "select",
        "id, sid, cid, createtime",
        "from stu_cls_rel",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT)
    })
    StuClsRel selectByPrimaryKey(Long id);

    @UpdateProvider(type=StuClsRelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StuClsRel record, @Param("example") StuClsRelExample example);

    @UpdateProvider(type=StuClsRelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StuClsRel record, @Param("example") StuClsRelExample example);

    @UpdateProvider(type=StuClsRelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StuClsRel record);

    @Update({
        "update stu_cls_rel",
        "set sid = #{sid,jdbcType=BIGINT},",
          "cid = #{cid,jdbcType=BIGINT},",
          "createtime = #{createtime,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(StuClsRel record);
}